﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Collections;

namespace Web.manager
{
    public partial class operatorlog : PageBase
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            SetDivePage(ref GridView1, ref GV);
            if (!IsPostBack)
            {
                this.txtStartTime.MyDateValue = DateTime.Now.AddDays(-1).ToString();
                this.txtEndTime.MyDateValue = DateTime.Now.AddDays(2).ToString();
                QueryData();
            }
        }
        public override void QueryData()
        {
            string modulename = "";
            if (Request["cmd"] != null)
            {
                switch (Request["cmd"].ToString())
                {
                    case "showchange":
                        //modulename = "通讯录变更";
                        Hashtable sysmodule = PhoneBook.Manage.sysModule.getByUrl("manager/PhoneBookManager.aspx");
                        if (sysmodule != null)
                            modulename = Commons.StrUtil.FormatValue(sysmodule["moduleid"]);
                        break;
                }
            }
            string username = this.txb_keyword.Text;
            DateTime starttime = Convert.ToDateTime(this.txtStartTime.MyDateValue);
            DateTime endtime = Convert.ToDateTime(this.txtEndTime.MyDateValue);
            DataSet ds = PhoneBook.Manage.OperatorLog.listoperatorlog(modulename, username, starttime, endtime);
            //绑定数据集
            GVDataBind(ref GridView1, ref GV, ds);
        }

        protected void btn_save_Click(object sender, EventArgs e)
        {
            AddLog("查询了一次操作日志");
            QueryData();
        }
    }
}